/*
 * Copyright (C) 2015-2021 Alibaba Group Holding Limited
 */

#include "integer.h"
#include "cx_utility.h"

DWORD get_fattime(void)
{
	DWORD res;
	struct tm *tm = cx_util_localtime();

	res =  (((DWORD)tm->tm_year - 1980) << 25)
			| ((DWORD)tm->tm_mon << 21)
			| ((DWORD)tm->tm_mday << 16)
			| (WORD)(tm->tm_hour << 11)
			| (WORD)(tm->tm_min << 5)
			| (WORD)(tm->tm_sec >> 1);
	return res;
}
